/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.hiddendanger.mapper;

import com.koron.hiddendanger.domain.FreeSnap;
import com.koron.hiddendanger.domain.HiddenDangerDiscovery;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface FreeSnapMapper {

    /**
     * 根据主键查询
     *
     * @param id
     * @return
     */
    FreeSnap queryOne(@Param("id") String id);

    /**
     * 根据指定条件查询随手拍详情
     *
     * @param description
     * @param corpCode
     * @param gridCode
     * @param state
     * @param submitTimeStart
     * @param submitTimeEnd
     * @param submiterCodeList
     * @param start
     * @param rows
     * @return
     */
    List<FreeSnap> queryByCondition(@Param("description") String description, @Param("corpCode") String corpCode, @Param("gridCode") String gridCode,
                                    @Param("state") Integer state, @Param("submitTimeStart") Date submitTimeStart, @Param("submitTimeEnd") Date submitTimeEnd,
                                    @Param("submiterCodeList") List<String> submiterCodeList, @Param("submitDepartmentName") String submitDepartmentName, @Param("start") Integer start, @Param("rows") Integer rows,
                                    @Param("keyword") String keyword);

    /**
     * 根据指定条件统计随手拍
     *
     * @param description
     * @param corpCode
     * @param gridCode
     * @param state
     * @param submitTimeStart
     * @param submitTimeEnd
     * @param submiterCodeList
     * @return
     */
    Integer countByCondition(@Param("description") String description, @Param("corpCode") String corpCode, @Param("gridCode") String gridCode,
                             @Param("state") Integer state, @Param("submitTimeStart") Date submitTimeStart, @Param("submitTimeEnd") Date submitTimeEnd,
                             @Param("submiterCodeList") List<String> submiterCodeList, @Param("submitDepartmentName") String submitDepartmentName,@Param("keyword")String keyword);

    /**
     * 新增随手拍
     *
     * @param bean
     * @return
     */
    Integer insert(@Param("bean") FreeSnap bean);

    /**
     * 批量新增随手拍
     *
     * @param freeSnapList
     * @return
     */
    Integer batchInsert(@Param("freeSnapList") List<FreeSnap> freeSnapList);

    /**
     * 修改随手拍
     *
     * @param bean
     * @return
     */
    Integer update(@Param("bean") FreeSnap bean);

    /**
     * 批量删除随手拍操作
     *
     * @param idList
     * @return
     */
    Integer deleteBatch(@Param("idList") List<String> idList);

    List<HiddenDangerDiscovery> queryDangerByFreeSnap(@Param("freeSnapId") String freeSnapId);
}
